


#include "tf_Point.h"


TfPoint::TfPoint()
{
	m_x = 0.0;
	m_y = 0.0;
	m_z = 0.0;
}

TfPoint::TfPoint(double ix,double iy,double iz)
{
	m_x = ix;
	m_y = iy;
	m_z = iz; 
}

TfPoint::TfPoint(const double*p)
{
	m_x = p[0];
	m_y = p[1];
	m_z = p[2];
}

TfPoint::TfPoint(const TfPoint &p)
{
	double pt[3];
	p.GetPoint(pt);
	m_x = pt[0];
	m_y = pt[1];
	m_z = pt[2];
}

TfPoint::~TfPoint()
{
}


double TfPoint::GetXYZ(int type)const
{
	if (type == 1 )
	{
		return m_x;
	}
	else if (type == 2)
	{
		return m_y;
	}
	else if (type == 3)
	{
		return m_z;
	}
	return 0.0;
}
void TfPoint::GetPoint(double pt[3])const
{
	pt[0] = m_x;
	pt[1] = m_y;
	pt[2] = m_z;
}

void TfPoint::SetPoint(double pt[3])
{
	m_x = pt[0];
	m_y = pt[1];
	m_z = pt[2];
}

TfPoint& TfPoint::operator=(TfPoint const& pt)
{
	double dpt[3];
	
	pt.GetPoint(dpt);
	m_x = dpt[0];
	m_y = dpt[1];
	m_z = dpt[2];

	return *this;
}